package com.evildevil.engines.bubble.texture;

/* loaded from: DDPixelFormat.class */
final class DDPixelFormat implements DDSurface {
    protected long size = 0;
    protected long flags = 0;
    protected long fourCC = 0;
    private String fourCCString = "";
    protected long rgbBitCount = 0;
    protected long rBitMask = 0;
    protected long gBitMask = 0;
    protected long bBitMask = 0;
    protected long rgbAlphaBitMask = 0;
    protected boolean isCompressed = true;

    public void setSize(long j) throws TextureFormatException {
        if (j != 32) {
            throw new TextureFormatException("Wrong DDPixelFormat size. DDPixelFormat size must be 32!");
        }
        this.size = j;
    }

    public void setFlags(long j) {
        this.flags = j;
        if ((j & 64) == 64) {
            this.isCompressed = false;
        } else if ((j & 4) == 4) {
            this.isCompressed = true;
        }
    }

    public void setFourCC(long j) {
        this.fourCC = j;
        if (this.isCompressed) {
            createFourCCString();
        }
    }

    private void createFourCCString() {
        this.fourCCString = new String(new byte[]{(byte) this.fourCC, (byte) (this.fourCC >> 8), (byte) (this.fourCC >> 16), (byte) (this.fourCC >> 24)});
    }

    public String getFourCCString() {
        return this.fourCCString;
    }

    public void setRGBBitCount(long j) {
        this.rgbAlphaBitMask = j;
    }

    public void setRBitMask(long j) {
        this.rBitMask = j;
    }

    public void setGBitMask(long j) {
        this.gBitMask = j;
    }

    public void setBBitMask(long j) {
        this.bBitMask = j;
    }

    public void setRGBAlphaBitMask(long j) {
        this.rgbAlphaBitMask = j;
    }
}